<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // 简易计算器   
        //    计算出一个结果
        //    return 还可以结束函数  --- 结束了switch   不需要加break

        function calc(num1, num2, fuHao) {
            switch (fuHao) {
                case '+': return num1 + num2;
                case '-': return num1 - num2;
                case '*': return num1 * num2;
                case '/': return num1 / num2;
            }
        }








    </script>

</body>

</html>